
/* MAIN.C file

 	Author:WhBoy-qiwu
 	QQ:270907714
 	E-Mail:270907714@qq.com
 	VER:1.0
 */



#include "stm8s_conf.h"
Decode_EXT DECODE_PARA Decode_Para;

volatile unsigned char LED_STATUS;



void delay_ms(unsigned int time)
{
	unsigned int i,j;
	for(i=time;i>0;i--)
	{
		for(j=5000;j>0;j--);
	}
}

void ENABLE_INTERRUPT(void)
{
	enableInterrupts() ;//enable interrupt
}



void main(void)
{
	CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV2);//MCU MAIN CLOCK=8MHZ 
	BSP_Init();
	ENABLE_INTERRUPT();
	SET_LED1(LED_STATUS,1);
	SET_LED2(LED_STATUS,1);
	LED_IOCTL(LED_STATUS);//all led light
	delay_ms(100);
	SET_LED1(LED_STATUS,0);
	SET_LED2(LED_STATUS,0);//LED Die Out

	PWMOUT_ON;
	//ProcPara.Proc_Mode=SCANMODE;
	while (1)
	{	
		LED_IOCTL(LED_STATUS);//LED handler
		//Decode_Handler();
		//ProcHandler();
	}
}
